Optimal. Leaf size=48 \[ -\frac {a \tanh ^{-1}(\cos (e+f x))}{2 f}-\frac {b \cot (e+f x)}{f}-\frac {a \cot (e+f x) \csc (e+f x)}{2 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {2827, 3853,
3855, 3852, 8} \begin {gather*} -\frac {a \tanh ^{-1}(\cos (e+f x))}{2 f}-\frac {a \cot (e+f x) \csc (e+f x)}{2 f}-\frac {b \cot (e+f x)}{f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2827
Rule 3852
Rule 3853
Rule 3855
Rubi steps
\begin {align*} \int \csc ^3(e+f x) (a+b \sin (e+f x)) \, dx &=a \int \csc ^3(e+f x) \, dx+b \int \csc ^2(e+f x) \, dx\\ &=-\frac {a \cot (e+f x) \csc (e+f x)}{2 f}+\frac {1}{2} a \int \csc (e+f x) \, dx-\frac {b \text {Subst}(\int 1 \, dx,x,\cot (e+f x))}{f}\\ &=-\frac {a \tanh ^{-1}(\cos (e+f x))}{2 f}-\frac {b \cot (e+f x)}{f}-\frac {a \cot (e+f x) \csc (e+f x)}{2 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.03, size = 91, normalized size = 1.90 \begin {gather*} -\frac {b \cot (e+f x)}{f}-\frac {a \csc ^2\left (\frac {1}{2} (e+f x)\right )}{8 f}-\frac {a \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{2 f}+\frac {a \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{2 f}+\frac {a \sec ^2\left (\frac {1}{2} (e+f x)\right )}{8 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.23, size = 50, normalized size = 1.04
method | result | size |
derivativedivides | \(\frac {a \left (-\frac {\csc \left (f x +e \right ) \cot \left (f x +e \right )}{2}+\frac {\ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{2}\right )-b \cot \left (f x +e \right )}{f}\) | \(50\) |
default | \(\frac {a \left (-\frac {\csc \left (f x +e \right ) \cot \left (f x +e \right )}{2}+\frac {\ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{2}\right )-b \cot \left (f x +e \right )}{f}\) | \(50\) |
risch | \(-\frac {i \left (i a \,{\mathrm e}^{3 i \left (f x +e \right )}+i a \,{\mathrm e}^{i \left (f x +e \right )}+2 b \,{\mathrm e}^{2 i \left (f x +e \right )}-2 b \right )}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{2}}-\frac {a \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{2 f}+\frac {a \ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}{2 f}\) | \(99\) |
norman | \(\frac {-\frac {a}{8 f}+\frac {a \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{8 f}-\frac {b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2 f}+\frac {b \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 f}-\frac {a \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4 f}}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} \left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}+\frac {a \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 f}\) | \(118\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 65, normalized size = 1.35 \begin {gather*} \frac {a {\left (\frac {2 \, \cos \left (f x + e\right )}{\cos \left (f x + e\right )^{2} - 1} - \log \left (\cos \left (f x + e\right ) + 1\right ) + \log \left (\cos \left (f x + e\right ) - 1\right )\right )} - \frac {4 \, b}{\tan \left (f x + e\right )}}{4 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 104 vs.
\(2 (48) = 96\).
time = 0.36, size = 104, normalized size = 2.17 \begin {gather*} \frac {4 \, b \cos \left (f x + e\right ) \sin \left (f x + e\right ) + 2 \, a \cos \left (f x + e\right ) - {\left (a \cos \left (f x + e\right )^{2} - a\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + {\left (a \cos \left (f x + e\right )^{2} - a\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{4 \, {\left (f \cos \left (f x + e\right )^{2} - f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sin {\left (e + f x \right )}\right ) \csc ^{3}{\left (e + f x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.46, size = 92, normalized size = 1.92 \begin {gather*} \frac {a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 4 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}\right ) + 4 \, b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - \frac {6 \, a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 4 \, b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + a}{\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2}}}{8 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.72, size = 81, normalized size = 1.69 \begin {gather*} \frac {b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{2\,f}-\frac {{\mathrm {cot}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (\frac {a}{2}+2\,b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{4\,f}+\frac {a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2}{8\,f}+\frac {a\,\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{2\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________